<template>
  <div>
    <TypeNav/>
    <ListContainer/>
    <TodayRecommend/>
    <Rank/>
    <Like/>
    <Floor v-for="floor in floorList" :key="floor.id" :list="floor"/>
    <Brand/>
  </div>
</template>

<script>
import ListContainer from './Container/ListContainer.vue'
import TodayRecommend from './TodayRecommend/TodayRecommend.vue'
import Rank from './Rank/Rank.vue'
import Like from './Like/Like.vue'
import Floor from './Floor/Floor.vue'
import Brand from './Brand/Brand.vue'

import { mapState } from 'vuex';
export default {
  name:'Home',
  components:{ListContainer,TodayRecommend,Rank,Like,Floor,Brand},
  mounted(){
    // 派发 楼层 数据
    this.$store.dispatch("home/getFloor");
    // 获取 token 对应的用户信息
    // this.$store.dispatch('user/getUserInfo')
  },
  computed:{
    ...mapState({
      floorList: state => {
        return state.home.getFloor
      }
    })
  }
}
</script>

<style>

</style>